<!--
 * @Description: Description
 * @Author: zhaojiansen
 * @Date: 2022-11-15 13:32:08
 * @LastEditors: zhaojiansen
 * @LastEditTime: 2022-11-15 17:46:18
-->
<template>
  <div class="essentialAttribute">
    <div class="essentialAttribute-height">创建规则</div>
    <div class="essentialAttribute-text">
      <div>
        在全部用户中，将满足以下条件的用户分为 2
        个分层，系统会按照以下自定义分层的顺序进行用户匹配，同一用户会被优先匹配在顺序靠前的分层中
      </div>
      <el-button type="text">查看实例</el-button>
    </div>
    <div class="creatingRule-box">
      <div
        class="creatingRule-box-content"
        v-for="(item, i) in addingLayers"
        :key="i"
      >
        <div class="creatingRule">
          <div>{{ item.addingLayersText }}</div>
          <i class="el-icon-more"></i>
        </div>
      </div>
      <div class="creatingRule-dashed" @click="addingLayersclick">
        <i class="el-icon-plus"></i>
        <div style="margin-left: 5px">添加分层</div>
      </div>
      <!-- <el-button size="small" round   style=" border: 1px dashed gray;" >小型按钮</el-button> -->
    </div>
    <div class="creatingRule-content">
      <el-input
        type="text"
        placeholder="请输入内容"
        v-model="text"
        maxlength="50"
        show-word-limit
      >
      </el-input>
      <div style="margin: 10px 0"></div>
      <el-input
        type="textarea"
        placeholder="可输入分层描述"
        v-model="textarea"
        maxlength="120"
        show-word-limit
      >
      </el-input>

      <div class="andor-content">
        <div class="andor">
          <div class="shu1"></div>
          <div class="text">且</div>
          <div class="shu2"></div>
        </div>
        <div class="content">
          <div class="content-property">
            <div class="content-property-text">
              <div class="text">客户属性满足</div>
              <div class="property-text">
                <el-button type="text" icon="el-icon-plus">添加</el-button>
              </div>
            </div>
            <div class="content-property-select">
              <el-select v-model="value" placeholder="请选择">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
              <el-select v-model="value" placeholder="请选择">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
              <el-select v-model="value" placeholder="请选择">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
              <el-button type="text" icon="el-icon-plus">添加</el-button>
            </div>
          </div>
          <div class="content-behavior">
            <div class="content-behavior-text">
              <div class="text">客户行为满足</div>
              <div class="behavior-text">
                <el-button type="text" icon="el-icon-plus">添加</el-button>
              </div>
            </div>
                  <div class="content-property-select">
              <el-select v-model="value" placeholder="请选择">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
              <el-select v-model="value" placeholder="请选择">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
              <el-select v-model="value" placeholder="请选择">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
              <el-button type="text" icon="el-icon-plus">添加</el-button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      text: "",
      textarea: "",
      addingLayersTexts: 0,
      options: [],
      addingLayers: [
        { addingLayersText: "分层" + this.addingLayersTexts },
        { addingLayersText: "分层" + this.addingLayersTexts },
      ],
    };
  },
  methods: {
    addingLayersclick() {
      //   if (this.addingLayers++) {
      //     for (let i = j; i < addingLayers.lenght + 1; i++) {
      //     }
      //   }
    },
  },
};
</script>

<style lang="scss" scoped>
.essentialAttribute {
  .essentialAttribute-height {
    font-size: 15px;
    font-weight: 900;
  }
  .essentialAttribute-text {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: gray;
    div {
      margin-right: 5px;
    }
  }
  .creatingRule-box {
    display: flex;
    .creatingRule-box-content {
      display: flex;
      .creatingRule {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-left: 10px;
        padding-right: 10px;
        width: 200px;
        height: 25px;
        font-size: 13px;
        // border: 1px solid gray;
        color: gray;
        //   border: 1px solid gray;
        border-radius: 20px;
        box-shadow: 0px 0px 7px 0px rgba(0, 0, 0, 0.16);
        margin-bottom: 5px;
        margin-left: 5px;
      }
    }
    .creatingRule-dashed {
      display: flex;
      align-items: center;
      justify-content: center;
      padding-left: 10px;
      padding-right: 10px;
      width: 200px;
      height: 25px;
      font-size: 13px;
      border: 1px dashed gray;
      color: gray;
      //   border: 1px solid gray;
      border-radius: 20px;
      box-shadow: 0px 0px 7px 0px rgba(0, 0, 0, 0.16);
      margin-bottom: 5px;
      margin-left: 5px;
    }
  }
  .creatingRule-content {
    border: 1px solid gray;
    .andor-content {
      display: flex;
      .andor {
        display: flex;
        flex-direction: column;
        align-items: center;
        .shu1 {
          height: 100%;
          width: 2px;
          background-color: gray;
        }
        .text {
          width: 20px;
          height: 20px;
          background-color: blue;
          text-align: center;
          line-height: 20px;
        }
        .shu2 {
          height: 100%;
          width: 2px;
          background-color: gray;
        }
      }
      .content {
        .content-property {
          .content-property-text {
            display: flex;
            align-items: center;
          }
          border: 1px solid gray;
        }
        .content-behavior{
         .content-behavior-text {
            display: flex;
            align-items: center;
          }
          border: 1px solid gray;
        }
      }
    }
  }
}
</style>
